﻿using System;
using SingleSignOn.Entities;

namespace SingleSignOn.Interfaces
{
    public interface ISingleSignOnDatabase : IBaseDB
    {
        /// <summary>
        /// Signs the in.
        /// </summary>
        /// <param name="userName">Name of the user.</param>
        /// <param name="password">The password.</param>
        /// <returns></returns>
        User SignIn(string userName, string password);

        /// <summary>
        /// Signs the out.
        /// </summary>
        /// <param name="user">The user.</param>
        void SignOut(User user);

        /// <summary>
        /// Gets the new token.
        /// </summary>
        /// <param name="userName">Name of the user.</param>
        /// <returns></returns>
        Token GetNewToken(string userName);

        /// <summary>
        /// Validates the token.
        /// </summary>
        /// <param name="token">The token.</param>
        /// <returns></returns>
        bool ValidateToken(Token token);

        /// <summary>
        /// Expires the token.
        /// </summary>
        /// <param name="token">The token.</param>
        void ExpireToken(Token token);

        /// <summary>
        /// Gets the online users.
        /// </summary>
        /// <returns></returns>
        OnlineUserCollection GetOnlineUsers();

        /// <summary>
        /// Gets the security tokens.
        /// </summary>
        /// <returns></returns>
        SecurityTokenCollection GetSecurityTokens();
    }
}
